<?php
   require_once('system/dbConnect.php');
   require_once('system/MyFunc.php');   
   connect();
  $sql = "select * from videos";
      if($_POST)
  {
    $key = $_POST['key'];
    $sql = $sql." where videoname like '%{$key}%' ";
  }
  $result = fetch_array($sql);    
 ?>
 <table align="center" width="80%" border=1> 
 <tr>
   <th>用户编号</th>
   <th>视频名称</th>   
   <th>视频类型</th>
   <th>海报</th>
   <th>内容简介</th>
   <th>添加日期</th>
   <th>上传用户</th> 
   <th>点击率</th> 
   <th>下载量</th> 
   <th>下载地址</th> 
 </tr>
<?php
foreach ($result as $one ) 
 {
   echo '<tr>';
   echo '<td>'.$one['vid'].'</td>';
   echo '<td>'.$one['videoname'].'</td>';  
   echo '<td>'.$one['tid'].'</td>';
   echo '<td>'.$one['pic'].'</td>';
   echo '<td>'.$one['intro'].'</td>'; 
   echo '<td>'.$one['uploaddate'].'</td>';
   echo '<td>'.$one['uploadadmin'].'</td>';
   echo '<td>'.$one['hittimes'].'</td>';
   echo '<td>'.$one['downtimes'].'</td>';
   echo '<td>'.$one['address'].'</td>';
  }
  echo '</table>';  
?>